<?php
// 应用公共文件
use think\response\Json;

function jerror($data = '失败'): Json
{
    return jcode(0, $data ,'error');
}

function jsuccess($data = '成功'): Json
{
    return jcode(1, $data , 'success');
}


function jcode($code, $data = null, $type= '')
{
    return json(compact(['code', 'type','data']));
}
